#include<bits/stdc++.h>
using namespace std;
const int MAXN = 100005;

int main(){
	freopen("duel.in", "r", stdin);
	freopen("duel.out", "w", stdout);
	unsigned int n;
	cin >> n;
	unsigned int a[MAXN] = {0};
	while(n--){
		unsigned int tmp;
		cin >> tmp;
		a[tmp]++;
	}
	
	/*
	for(int i = 0;i < MAXN; i++){
		if(a[i] == 0) continue;
		for(int j = i;j < MAXN;j++){
			if(a[j] == 0) continue;
			if(a[j] <= a[i]) a[i] -= a[j];
			if(a[j] >= a[i]) {
				a[i] = 0;
				int left = a[j] - a[i];
				for(auto& i:a){
					if(i == 0) continue;
					if(left > i){
						i = 0;
						left -= i;
					}else{
						i -= left;
						break;
					}
				}
			}	
		}
	}
	*/
	
	unsigned long long bltv = 0;
	for(int i = MAXN-1; i >= 0 ;i--){
		if(a[i] == 0) continue;
		unsigned int tmp = a[i];
		if(bltv > a[i]){
			a[i] = 0;
			bltv -= a[i];
		}else{
			a[i] -= bltv;
			bltv = 0;
		}
		bltv += tmp;
	}
	unsigned int cnt = 0;
	for(auto i:a){
		cnt += i;
	}
	//cnt += bltv;
	cout << cnt;
	return 0;
}
